/**
 * 
 */
package guice.trail.lessons.scopes;

import com.google.inject.Key;
import com.google.inject.Provider;
import com.google.inject.Scope;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * 
 */
public class UniqueInstanceScope implements Scope {

	/**
	 * {@inheritDoc}
	 * 
	 * @see com.google.inject.Scope#scope(com.google.inject.Key,
	 *      com.google.inject.Provider)
	 */
	public Provider scope(Key key, Provider unscoped) {
		System.out.println("Scoping " + key.toString());
		// Just use default
		return unscoped;
	}

	/**
	 * {@inheritDoc}
	 * 
	 */
	public String toString() {
		return UniqueInstanceScope.class.getSimpleName();
	}

}
